home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 26 (Anniversary Edition)
/
Volume 26 [Anniversary Edition] - JOGO DISK .iso
/
Fight
/
fightingschool.swf
/
scripts
/
frame_7
/
PlaceObject2_120_8
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2006-06-09
|
3KB
|
95 lines
onClipEvent(enterFrame){
if(_root.PAUSE == false)
{
if(_root.SPon == true)
{
if(this.hitTest(_root.b1.plyr1.sphit))
{
hp -= _root.SPpow;
_root.sfpunch.start();
ACTION = false;
this.char.gotoAndPlay("onhit");
if(0 >= hp or _root.b1.HITcnt == 2)
{
ACTION = false;
this.tact.ACTION = true;
this.char.gotoAndPlay("fly");
}
}
}
if(ACTION == true)
{
if(_root.b1._x < this._x and moving != "LEFT")
{
this.gotoAndPlay("n_l");
moving = "LEFT";
}
else if(this._x < _root.b1._x and moving != "RIGHT")
{
this.gotoAndPlay("n_r");
moving = "RIGHT";
}
if(moving != false and cnt < stopcnt)
{
cnt++;
if(this._x < _root.b1._x + 70 and _root.b1._x - 70 < this._x)
{
if(cnt == stopcnt - 7)
{
this.char.gotoAndPlay("att");
}
else
{
if(movr == true or movl == true)
{
this.char.gotoAndPlay("stop");
}
movr = false;
movl = false;
}
}
else if(moving == "RIGHT")
{
if(this._x < _root.MAX_X)
{
this._x += stepdis;
if(movr == false)
{
this.gotoAndPlay("w_r");
movr = true;
}
}
}
else if(moving == "LEFT")
{
if(_root.MIN_X < this._x)
{
this._x -= stepdis;
if(movl == false)
{
this.gotoAndPlay("w_l");
movl = true;
}
}
}
tmptime2 = getTimer();
waittime = random(500) + 1000;
}
else
{
this.char.gotoAndPlay("stop");
movr = false;
movl = false;
tmptime1 = getTimer();
moving = false;
if(waittime < tmptime1 - tmptime2)
{
cnt = 0;
stopcnt = random(30) + 10;
moving = true;
}
}
}
}
}